//-----------------------------------------------------------------------
//<copyright file="CongTyBLL.cs
//Code gen by tool.
//</copyright>
//-----------------------------------------------------------------------
using System;
using PMS.Exceptions;
using System.Collections.Generic;
using PMS.DAL;
using PMS.Entity;

namespace PMS.BLL
{
	public class CongTyBO : BaseBO
	{
		// Interface Instant Object
		private readonly ICongTyDAO congtyInterfaceObject = null;

		// Constructor
		public CongTyBO()
		{
			congtyInterfaceObject = new DAL.ServiceFactory<ICongTyDAO>().CurrentDAL;
		}

		#region CongTy

		/// <summary>
		///
		/// </summary>
		/// <param name="congty"></param>
		public CongTy CreateCongTy(CongTy congty)
		{
			try
			{
				return congtyInterfaceObject.CreateCongTy(congty);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access CreateCongTy Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="congty"></param>
		public void UpdateCongTy(CongTy congty)
		{
			try
			{
				congtyInterfaceObject.UpdateCongTy(congty);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access UpdateCongTyException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="congty"></param>
		public void DeleteCongTy(CongTy congty)
		{
			try
			{
				congtyInterfaceObject.DeleteCongTy(congty);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access DeleteCongTyException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		public CongTies GetAllCongTy()
		{
			try
			{
				return congtyInterfaceObject.GetAllCongTy();
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetAllCongTy Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="maCTy"></param>
		public CongTy GetCongTyByID(int maCTy)
		{
			try
			{
				return congtyInterfaceObject.GetCongTyByID(maCTy);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetCongTyBy ID Exception", ex);
			}
		}

		#endregion
	}
}
